package com.vne.skyemart.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.vne.skyemart.dao.CategoriesProductDao;
import com.vne.skyemart.model.CategoriesProduct;
import com.vne.skyemart.service.CategoriesProductService;

@Service("categoriesProductService")
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class CategoriesProductServiceImpl implements CategoriesProductService{
	@Autowired
	private CategoriesProductDao categoriesProductDao;

	public CategoriesProductDao getCategoriesProductDao() {
		return categoriesProductDao;
	}

	public void setCategoriesProductDao(CategoriesProductDao categoriesProductDao) {
		this.categoriesProductDao = categoriesProductDao;
	}
	public CategoriesProductServiceImpl() {}
	@Transactional(propagation = Propagation.SUPPORTS,readOnly = false)
	@Override
	public void addCategoriesProduct(CategoriesProduct categoriesproduct) {
		categoriesProductDao.save(categoriesproduct);		
	}

	@Override
	public List<CategoriesProduct> listCategoriesProduct() {
		return categoriesProductDao.findAll();
	}
	
}
